package cn.jtfadmin.activiti.domain.dto;

import cn.jtfadmin.base.lang.enums.BooleanEnum;
import lombok.Data;
import org.activiti.engine.task.DelegationState;

import java.io.Serializable;
import java.util.Date;
import java.util.Map;

/**
 * 任务dto
 * @author jtf
 * @since 0.0.1
 */
@Data
public class TaskDTO implements Serializable {

    /**
     * 任务id
     */
    protected String id;

    /**
     * 任务名称
     */
    protected String name;

    /**
     * 任务描述
     */
    protected String description;

    /**
     * 任务紧急程度
     */
    protected int priority;

    /**
     * 任务发起人
     */
    protected String owner;

    /**
     * 任务执行人
     */
    protected String assigner;

    /**
     * 流程实例id
     */
    protected String processInstanceId;


    /**
     * 执行id
     */
    protected String executionId;

    /**
     * 流程定义id
     */
    protected String processDefinitionId;

    /**
     * 流程创建时间
     */
    protected Date createTime;

    /**
     * 流程定义key
     */
    protected String taskDefinitionKey;


    /**
     * 任务到期时间
     */
    protected Date dueDate;

    /**
     * 上级任务id
     */
    protected String parentTaskId;

    /**
     * 表单key
     */
    protected String formKey;

    /**
     * 租户id
     */
    protected String tenantId;

    /**
     * 任务本地变量
     */
    protected Map<String, Object> taskLocalVariables;

    /**
     * 任务变量
     */
    protected Map<String, Object> processVariables;

    /**
     * 领取时间
     */
    protected Date claimTime;


    /**
     * 挂起标志
     */
    protected BooleanEnum suspendedFlag;

    /**
     *
     */
    protected DelegationState delegationState;

    public TaskDTO() {
    }

    public TaskDTO(String id, String name, String description, int priority, String owner, String assigner, String processInstanceId, String executionId, String processDefinitionId, Date createTime, String taskDefinitionKey, Date dueDate, String parentTaskId, String formKey, String tenantId, Map<String, Object> taskLocalVariables, Map<String, Object> processVariables, Date claimTime, BooleanEnum suspendedFlag, DelegationState delegationState) {
        this.id = id;
        this.name = name;
        this.description = description;
        this.priority = priority;
        this.owner = owner;
        this.assigner = assigner;
        this.processInstanceId = processInstanceId;
        this.executionId = executionId;
        this.processDefinitionId = processDefinitionId;
        this.createTime = createTime;
        this.taskDefinitionKey = taskDefinitionKey;
        this.dueDate = dueDate;
        this.parentTaskId = parentTaskId;
        this.formKey = formKey;
        this.tenantId = tenantId;
        this.taskLocalVariables = taskLocalVariables;
        this.processVariables = processVariables;
        this.claimTime = claimTime;
        this.suspendedFlag = suspendedFlag;
        this.delegationState = delegationState;
    }
}
